feat: 完成SubAgent DAG调度器并修复infra稳定性#317
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| // defaultRoleSelector 生成默认角色选择器:优先读取 owner_id 中的合法角色,否则回退默认角色。 | ||
| func defaultRoleSelector(defaultRole Role) RoleSelector { | ||
| return func(todo agentsession.TodoItem) Role { | ||
| candidate := Role(todo.OwnerID) |
There was a problem hiding this comment.
defaultRoleSelector treats todo.OwnerID as trusted role input. OwnerID is task data and mutable, so this allows role injection (security boundary issue). It also conflicts with ClaimTodo writing runtime worker IDs into OwnerID, causing retry attempts to silently change role selection. Role should come from trusted scheduler policy/config, not persisted task owner metadata.
| s.sortReadyTasks(ready, state.readySince) | ||
|
|
||
| started, err := s.startReadyTasks(ctx, ready, state) | ||
| if err != nil { |
There was a problem hiding this comment.
On non-context errors from collectReadyTasks/startReadyTasks, Run returns immediately without canceling already-running tasks (state.running). That can leave todos stuck in in_progress and drop outcome writeback. Consider canceling/marking running tasks before returning on these error paths, same as the ctx.Err()/handleOneOutcome branches.
| } | ||
|
|
||
| if item.Status != TodoStatusFailed { | ||
| if item.Status != TodoStatusFailed && item.Status != TodoStatusPending { |
There was a problem hiding this comment.
This normalization clears FailureReason for blocked todos, but scheduler retry logic writes FailureReason while setting status=blocked (handleTaskFailure). The reason is erased immediately, so retry state loses failure context. Either preserve reason for blocked or store retry reason separately.
|
/code 帮我修复review,然后解决test覆盖率问题 |
完成情况已按你的要求修复 review 问题并处理覆盖率缺口,变更已推送到当前 PR 分支 已修复问题
测试与覆盖率
提交信息
未执行项:未直接访问 Codecov 平台复核 patch 百分比(本地已完成覆盖率回归验证)。 |
- remove default role derivation from todo owner metadata - cancel running tasks when scheduler loop exits on internal errors - preserve blocked todo failure reason for retry diagnostics - add coverage for scheduler/session error and edge branches Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
|
解决冲突 |
处理结果已按“解决冲突”完成修复并推送到当前 PR 分支 本次修改
验证
提交与推送
未执行项:未进行额外功能改动(仅处理冲突相关代码与测试对齐)。 |
… detection Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
|
/code 继续解决冲突 |
处理结果已继续完成冲突修复,并推送到当前 PR 分支 本次修改
验证
提交与推送
未执行项
|
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
关联
Closes #275
本次改动
1) SubAgent 调度器落地(issue #275)
2) Todo 模型增强(服务调度器回写)
3) Infra 稳定性修复(顺带修复全量测试失败)
验证
go test ./...